{include file="header.html"}
<link rel="stylesheet" href="{url('/style/css/member.css')}">
{include file="ur_here.html"}
<div id="container">
    <div class="fn-clear mt20 pb20">
        {include file="member/menu.html"}
        <div class="fn-right hy-r">
            <script type="text/javascript" src="{url('/style/fullavatar/fullAvatarEditor.js')}"></script>
            <script type="text/javascript" src="{url('/style/fullavatar/swfobject.js')}"></script>
            <div>
                <p id="swfContainer">
                    本组件需要安装Flash Player后才可使用，请从<a href="http://www.adobe.com/go/getflashplayer">这里</a>下载安装。
                </p>
            </div>
            <script type="text/javascript">
                swfobject.addDomLoadEvent(function () {
                    var swf = new fullAvatarEditor("swfContainer", {
                                id: 'swf',
                                upload_url: '/member/photo',
                                src_upload:1,
                                avatar_sizes:'160*160|80*80|30*30',
                                avatar_sizes_desc:'160*160|80*80|30*30',
                                src_url: '{$member.photo}'
                            }, function (msg) {
                                switch(msg.code)
                                {
                                    case 1 : break;
                                    case 2 : break;
                                    case 3 :
                                        if(msg.type == 0)
                                        {
                                            alert("摄像头已准备就绪且用户已允许使用。");
                                        }
                                        else if(msg.type == 1)
                                        {
                                            alert("摄像头已准备就绪但用户未允许使用！");
                                        }
                                        else
                                        {
                                            alert("摄像头被占用！");
                                        }
                                        break;
                                    case 5 :
                                        if(msg.type == 0)
                                        {
                                            location.reload();
                                        }
                                        break;
                                }
                            }
                    );
                    document.getElementById("upload").onclick=function(){
                        swf.call("upload");
                    };
                });
            </script>
        </div>
    </div>
</div>
{include file="footer.html"}